from flask import Flask
import config
import env_config
from flask_sqlalchemy import SQLAlchemy
from flask_apscheduler import APScheduler
from flask_login import LoginManager

db = SQLAlchemy()
login = LoginManager()
login.login_view='index.login'
env_config._init()
app = Flask(__name__)
app.config.from_object(config.Config)
app.jinja_env.variable_start_string = '{{'
app.jinja_env.variable_end_string = '}}'
db.init_app(app)

login.init_app(app)

from app.index import indexbp
app.register_blueprint(indexbp)

from app.sms import smsbp
app.register_blueprint(smsbp,url_prefix='/sms')

from app.tools import toolsbp
app.register_blueprint(toolsbp,url_prefix='/tools')

from app.admin import adminbp
app.register_blueprint(adminbp,url_prefix='/admin')


scheduler = APScheduler()
scheduler.init_app(app)
scheduler.start()












